<?php	if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
 * Tokaban Standard System
 *
 * Tokaban framework for PHP
 *
 * @package		ap_standard_system
 * @author		Tokaban R&D Team
 * @copyright	Copyright (c) 2009, Tokaban, Inc. 
 * @since		Version 2.0
 *   
 */ 
   
// ------------------------------------------------------------------------
class check_infomation_user extends Controller 
{	
	var $m_language 		= ''; 
	var $m_nid_user 		= ''; 
			 
	var $m_link_page		= ''; 
	var $m_event_index		= ''; 
	var $m_view_index		= '';
	 
	var $m_error_message	= '';
	var $m_form_title		= '';
	
	// Form login
	var $m_txt_user_name	= ''; 
	var $m_txt_password		= '';
	
	//Form contact
	var $m_txt_cfullname	= '';
	var $m_txt_caddress		= '';
	var $m_txt_nphone		= '';
	var $m_txt_cemail		= '';
	var $m_txt_cnote		= '';
	
	var $nid_order			= '';
	
	var $m_display_login	= 'block';
	var $m_display_contact	= 'none';
	  
	// ------------------------------------------------------------------------
	
/** 
 * Constructor
 *
 * Load cac thu vien can su dung cho class 
 *
 * @access	public 
 */	
function check_infomation_user()
	{ 
		// 
		// DINH NGHIA BAT BUOC TRONG TAT CA CAC CONTROLLER.
		// KHONG DUOC TU Y THAY DOI CAC DONG THONG TIN BEN DUOI. 
		//
		parent::Controller();  
		session_start();
		$this->load->database();
		$this->load->helper('ap_db');	
		$this->load->helper('ap_function');
		$this->load->helper('ap_html');
		$this->load->helper('ap_view');
		$this->load->helper('ap_object');
		$this->load->helper('ap_module');
		$this->load->helper('ap_captcha_helper');			
		// 
		// CAC DINH NGHIA CAN THIET KHAC
		// 
		$this->load->model('payment_model');
		
	} 
	
function null_cart()
	{
		$this->load->view('ap_null_cart');
	}	
	// ------------------------------------------------------------------------
	
/**
 * Goi tuan tu cac ham theo dung quy dinh ve luong du lieu
 * 
 * @access	public
 */		
function index()
	{
		$this->get_data();
	}		
	
	// ------------------------------------------------------------------------

function check_user()
	{
		$this->m_txt_cfullname 		= Fget_userdata('session_customer_full_name');
		$this->m_txt_caddress 		= Fget_userdata('session_customer_address');
		$this->m_txt_nphone 		= Fget_userdata('session_customer_phone');
		$this->m_txt_cemail 		= Fget_userdata('session_customer_email');
		$this->m_txt_cnote 			= Fget_userdata('session_customer_note');
		
		$this->view();
	}

function get_data()
	{
		//$this->m_language = Fget_userdata('session_user_language');										
		//$this->load->language('ap',$this->m_language);
		
		$this->m_display_login				= 'none';
		$this->m_display_contact			= 'block';
		
		// Your code at here
		if(isset($_POST['txt_cfullname']))
				$this->m_txt_cfullname 		= $_POST['txt_cfullname'];
		
		if(isset($_POST['txt_caddress']))
				$this->m_txt_caddress 		= $_POST['txt_caddress'];
			
		if(isset($_POST['txt_nphone']))
				$this->m_txt_nphone 		= $_POST['txt_nphone'];
		
		if(isset($_POST['txt_cemail']))
				$this->m_txt_cemail 		= $_POST['txt_cemail'];
		
		if(isset($_POST['txt_cnote']))
				$this->m_txt_cnote 			= $_POST['txt_cnote'];
				
		if($this->insert_contact() === TRUE )
			redirect ('order_complete');
		
		$this->view();	
	}

function view()
	{
	
		$data['display_login']		= $this->m_display_login;
		$data['display_contact']	= $this->m_display_contact;
		
		$data['txt_cfullname']		= $this->m_txt_cfullname;
		$data['txt_caddress']		= $this->m_txt_caddress;
		$data['txt_nphone']			= $this->m_txt_nphone;
		$data['txt_cemail']			= $this->m_txt_cemail;
		$data['txt_cnote']			= $this->m_txt_cnote;
		
		$data['txt_user_name']	= $this->m_txt_user_name;
		$data['error_message']	= $this->m_error_message;
		
		$data['title']			= '';
		$data['tags']			= '';
		$data['description']	= '';
		
		$data['menu_sec']		= '';
		$data['menu_cat']		= '';
		$data['g_ishome']		= 0;
		$this->load->view('check_infomation_user',$data);
	}


/**
 *-------------------------------------------------------------------
 * @creator 		: Pham Quang Tri - tri_pq88@tokaban.com

 * @finished date	: 2009/12/13
 * @description		: Insert du lieu vao tcity
 * @access	        : private
 *
 * @param string	: None
 * 					: 
 * @return string	: None
 *-------------------------------------------------------------------
 * @editor   	    : 
 * @finished date	: 
 * @editing content	: 
 *-------------------------------------------------------------------
 */		
private function insert_contact()
	{

			Fset_userdata('session_customer_full_name', $this->m_txt_cfullname);
			Fset_userdata('session_customer_address', $this->m_txt_caddress);
			Fset_userdata('session_customer_phone', $this->m_txt_nphone);			
			Fset_userdata('session_customer_email', $this->m_txt_cemail);
			Fset_userdata('session_customer_note', $this->m_txt_cnote);
					
			return TRUE;
	}

// END do_init class
}		
/* End of file do_init.php */
/* Location: controller/do_init.php */